package DataStructure;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Stack;;

class Solver1654
{	private String cipher;
	private Stack<Character> rs=new Stack<Character>();
	
	public void Input() throws IOException
	{	BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
		cipher=in.readLine();
	}
	public void Solve()
	{	Stack<Character> stack=new Stack<Character>();
		for (int i=0;i<cipher.length();i++)
		{	if (stack.size()>0)
			{	char c=cipher.charAt(i);
				if (stack.peek()==c)
					stack.pop();
				else
					stack.push(c);
			}
			else
				stack.push(cipher.charAt(i));
		}
		while (!stack.empty())
			rs.push(stack.pop());
	}
	public void Output()
	{	PrintWriter out=new PrintWriter(System.out);
		while (!rs.empty())
			out.print(rs.pop());
		out.println();
		out.flush();
	}
	public void main() throws IOException
	{	Input();
		Solve();
		Output();
	}
}
public class P1654
{	public static void main(String[] args) throws IOException
	{	Solver1654 solver=new Solver1654();
		solver.main();
	}
}
